<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../include/admincontent.jsp" %>
<div id="Content">
    <div id="searchbox">
        <form>
            <div class="toolbars">
                <a id="okbtn">
                    <em class="ico16 add_section_16"></em>
                    <span class="menu_span" title="确定">确定</span>
                </a>
            </div>
            <table class="treeTable searchform" style="margin-top: 10px">
                <thead>
                <tr>
                    <td width="50">关键字:</td>
                    <td width="200">
                        <div><input type="text" name="key"/></div>
                    </td>
                    <td width="120">
                        <div class="toolbars">
                            <a id="baseexaminer_search" >
                                <em class="ico16 search_16"></em>
                                <span class="menu_span" title="查询">查询</span>
                            </a>
                        </div>
                    </td>
<%--                    <td width="60">
                        <button id="okbtn" type="button" class="op">确定</button>
                    </td>--%>
                    <td></td>
                </tr>
                </thead>
            </table>
        </form>
    </div>
    <table class="treeTable" id="tablelist" lay-filter="sekectUserTable">
        <thead>
        <tr>
            <td width="20"><input type="checkbox" class="allcheckbox" title="选择全部/取消全选"/></td>
            <td width="60">员工号</td>
            <td width="60">姓名</td>
            <td width="80">电话</td>
            <td>部门</td>
        </tr>
        </thead>
        <tbody id="result"></tbody>
    </table>
    <div id="page"></div>
</div>
<script type="text/javascript">
    var tavkeIns;
    $(document).ready(function () {
        getList();
        $('#baseexaminer_search').click(function () {
            getList();
        });

/*        layui.use('table',function () {
            var table = layui.table;

            tavkeIns = table.render({
                id:'sekectUserTable',
                elem:'#tablelist',
                url: '/BaseExaminer/getulistsLayuiJson',
                title:'用户数据表',
                height:'full',
                cols:[[
                    {type:'checkbox',fixed:'left'},
                    {field:'ucode',title:'员工号',fixed: 'left',sort:true},
                    {field:'uname',title:'姓名',fixed: 'left',sort:true},
                    {field:'utel',title:'电话',fixed: 'left',sort:true},
                    {field:'udeptname',title:'部门',fixed: 'left',sort:true}
                ]],
                page:true
            });
        });*/

        //添加成员
        $('#okbtn').click(function () {
            var i = 0;
            var str = '';
            $('#result tr').each(function () {
                var cb = $(this).find('input[type=checkbox]');
                if (cb.is(":checked")) {
                    var ucode = $(this).find('td:eq(1)').text();
                    var uname = $(this).find('td:eq(2)').text();
                    str += '<tr><td>' + ucode + '<input type="hidden" value="' + ucode + '" datatype="*" nullmsg="考官编号不能为空"/></td>';
                    str += '<td>' + uname + '<input type="hidden" value="' + uname + '" datatype="*" nullmsg="考官姓名不能为空"/></td>';
                    str += '<td><div><input type="text" value="' + $(this).find('td:eq(3)').text() + '" datatype="*" nullmsg="考官电话不能为空" /></div></td>';
                    str += '<td><div><input type="text" datatype="*" nullmsg="评分权重不能为空" /></div></td>';
                    str += '<td><div><select><option value="否">否</option><option value="是">是</option></select></div></td>';
                    str += '<td class="tdwidth"><button type="button"  class="layui-btn layui-btn-sm layui-btn-normal del"><i class="layui-icon"></i> 删除</button></td></tr>';
                    i++;
                }
            });

            if (i == 0) {
                //$.Showmsg('请选择人员');
                layer.msg('请选择人员', {icon: 2});
            } else {
                parent.$('#result').append(str);
                parent.setItemNum();
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
            }
        });
    });

    function getList() {
        var url = '/BaseExaminer/getulists';
        $("#page").myPagination({
            cssStyle: "pagination",
            ajax: {
                on: true,
                url: url,
                param: $("form").serialize(),
                dataType: 'html',
                callback: function (data) {
                    $("#result").html(data);
                }
            }
        });
    }
</script>
</body>
</html>